<template>
  <input
    type="text"
    v-model.trim="inputValue"
    @keyup.enter="onAdd"
  >
</template>

<script>
import evtBus from '../event-bus/todolist';

export default {
  data () {
    return {
      inputValue: '',
    };
  },
  methods: {
    onAdd () {
      evtBus.$emit('添加', this.inputValue);
      this.inputValue = '';
    },
  },
}
</script>

<style scoped>

</style>